<template>
	<view class="">
		
		<view class="new" v-for="(item,index) in list" :key="index" >
			<view style="width: 600rpx;word-wrap: break-word;font-weight: bold;font-size: 32rpx;">{{item.title}}</view>
			<view style="width: 600rpx;word-wrap: break-word;">{{item.content}}</view>
		</view>	
		<u-loadmore :status="status" />
	</view>
</template>

<script>
	export default{
		data(){
			return{
				list:[],
				status: 'loadmore',
				page: 1,
			}
		},
		methods:{
			detail(item){
				uni.navigateTo({
					url:"./detail?id="+item.id
				})
			},
			get(){
			
				this.$u.post('/api/user/message', {
				   		
				   
				}, {}).then(res => {
				 	var resList = res.data
				 			  
				 	if (this.page == 1) {
				 		this.list = []
				 	}
				 	if (resList.length > 9) {
				 		this.status = 'loadmore'
				 		this.page = this.page + 1
				 	} else {
				 		this.status = 'nomore'
				 	}
				 	this.list = this.list.concat(resList)
				 	this.loading = false
				}).catch(err => {})
			}
		},
		onLoad() {
			this.get()
			
		},
		onReachBottom() {
			if (this.status == 'nomore') {
		
			} else {
				this.get()
			}
		
		},
		onPullDownRefresh() {
			this.page=1
			this.jiazai()
			setTimeout(function() {
				uni.stopPullDownRefresh()
			}, 1000)
		},
		
		
	}
</script>

<style>
	
	.new{
		background: #FFFFFF;
		box-shadow: 0px 4rpx 6rpx rgba(209, 209, 209, 0.26);
		border-radius: 20rpx;
		width: 690rpx;
		margin: auto;
		padding: 20rpx;
		margin-top: 20rpx;
		/* display: flex;
		justify-content: space-between; */
	}
	.u-collapse-head{
	   width: 690rpx;	
	}

	

</style>
